<template>
	<view class="">
		<view style="margin:10px;border-radius: 5px;overflow: hidden;">
			<image style="width: 100%;height: 80px; " :src="imgUrl?imgUrl:''" mode="aspectFill"></image>
		</view>
		<!-- <view  style="padding: 20px 10px;
		background: url('https://www.mnbtdm.com/upload/images/newshoverbg.png') ;background-size: cover;background-position: bottom;background-color: #fff;">
			<view >账户余额</view>
			<view style="font-size: 24px;margin: 5px 0;">￥{{zhData.zhMoney?zhData.zhMoney:'0.00'}}</view>
			<view >返利核销余额</view>
			<view style="font-size: 24px;margin: 5px 0;">￥{{zhData.flhxMoney?zhData.flhxMoney:'0.00'}}</view>
			<view >促销核销余额</view>
			<view style="font-size: 24px;margin: 5px 0;">￥{{zhData.cxhxMoney?zhData.cxhxMoney:'0.00'}}</view>
			<view >冻结余额</view>
			<view style="font-size: 24px;margin: 5px 0;">￥{{zhData.cusMoneyFrozen.fmoney?zhData.cusMoneyFrozen.fmoney:'0.00'}}</view>
		</view> -->
		<view style="padding: 20px 10px; background-color: #fff;font-size: 16px;">
				<view style="display: flex;font-size: 18px;">
					<image style="width: 30px;height: 30px;margin-right: 5px;"  src="/static/image/zh.png"></image>
					<view style="line-height: 30px;">账户信息</view>
				</view>
				<!-- background: url('/static/image/userBg.png') ;background-size: cover;background-position: bottom; -->
				<view style="margin: 5px 0 10px;border: 1px #aaa solid;border-radius: 10px; padding: 10px;">
					<view style="display: flex;justify-content: space-between; margin-bottom: 5px;">
						<text>当前余额:</text>
						<text>￥{{zhData.zhMoney?zhData.zhMoney:'0.00'}}</text>
					</view>
					<view style="display: flex;justify-content: space-between; margin-bottom: 5px;">
						<text>冻结金额:</text>
						<text>￥{{zhData.sumFrozen_zhMoney?zhData.sumFrozen_zhMoney:'0.00'}}</text>
					</view>
					<view style="display: flex;justify-content: space-between; margin-bottom: 5px;">
						<text>可用余额:</text>
						<text>￥{{zhData.appZhMoney?zhData.appZhMoney:'0.00'}}</text>
					</view>
					<view style="display: flex;justify-content: space-between; margin-bottom: 5px;">
						<text>信用额度:</text>
						<text>￥{{zhData.xyMoney?zhData.xyMoney:'0.00'}}</text>
					</view>
					
				</view>
				<view style="display: flex;font-size:18px;">
					<image style="width: 30px;height: 30px;margin-right: 5px;"  src="/static/image/fl.png"></image>
					<view style="line-height: 30px;">返利信息</view>
				</view>
				<view style="margin: 5px 0 10px;border: 1px #aaa solid;border-radius: 10px; padding: 10px;">
					<view style="display: flex;justify-content: space-between; margin-bottom: 5px;">
						<text>当前余额:</text>
						<text>￥{{zhData.flhxMoney?zhData.flhxMoney:'0.00'}}</text>
					</view>
					<view style="display: flex;justify-content: space-between; margin-bottom: 5px;">
						<text>冻结余额:</text>
						<text>￥{{zhData.sumFrozen_flMoney?zhData.sumFrozen_flMoney:'0.00'}}</text>
					</view>
					<view style="display: flex;justify-content: space-between; margin-bottom: 5px;">
						<text>可用余额:</text>
						<text>￥{{zhData.appFlMoney?zhData.appFlMoney:'0.00'}}</text>
					</view>
					
				</view>
				
				<view style="display: flex;font-size: 18px;">
					<image style="width: 30px;height: 30px;margin-right: 5px;"  src="/static/image/cx.png"></image>
					<view style="line-height: 30px;">促销信息</view>
				</view>
				<view style=" margin: 5px 0 10px;border: 1px #aaa solid;border-radius: 10px; padding: 10px;">
					
					<view style="display: flex;justify-content: space-between; margin-bottom: 5px;">
						<text>当前余额:</text>
						<text>￥{{zhData.cxhxMoney?zhData.cxhxMoney:'0.00'}}</text>
					</view>
					<view style="display: flex;justify-content: space-between; margin-bottom: 5px;">
						<text>冻结余额:</text>
						<text>￥{{zhData.sumFrozen_cxMoney?zhData.sumFrozen_cxMoney:'0.00'}}</text>
					</view>
					<view style="display: flex;justify-content: space-between; margin-bottom: 5px;">
						<text>可用余额:</text>
						<text>￥{{zhData.appCxMoney?zhData.appCxMoney:'0.00'}}</text>
					</view>
					
				</view>
				
				
				
		</view>
		
		
	</view>
	

</template>

<script>
	import util from '@/common/fire.js'
	export default {
		data() {
			return {
				imgUrl:'',
				zhData:''
			}
		},
		onShow: function () {
			
			// 顶部图片
			this.$u.api.shop.setListData({id:'02'})
				.then(res => {
					this.imgUrl=this.vuex_config.baseUrl+res.list[0].picUrl
				});
			
			
			this.$u.api.shop.getCusMoney()
				.then(res => {
					this.zhData = res;
					this.zhData.xyMoney = util.toFixed2(this.zhData.xyMoney)
					
					this.zhData.appZhMoney = util.toFixed2(this.zhData.appZhMoney)
					this.zhData.appFlMoney = util.toFixed2(this.zhData.appFlMoney)
					this.zhData.appCxMoney = util.toFixed2(this.zhData.appCxMoney)
					
					this.zhData.sumFrozen_zhMoney = util.toFixed2(this.zhData.sumFrozen_zhMoney)
					this.zhData.sumFrozen_flMoney = util.toFixed2(this.zhData.sumFrozen_flMoney)
					this.zhData.sumFrozen_cxMoney = util.toFixed2(this.zhData.sumFrozen_cxMoney)
					
					this.zhData.zhMoney = util.toFixed2(this.zhData.zhMoney)
					this.zhData.flhxMoney = util.toFixed2(this.zhData.flhxMoney)
					this.zhData.cxhxMoney = util.toFixed2(this.zhData.cxhxMoney)
				});
			
			// 我的账户
			// this.$u.api.shop.wecharCusMoney({cusCode:this.vuex_basCus.code,})
			// 	.then(res => {
			// 		this.zhData = res.list[0];
			// 		this.zhData.zhMoney = util.toFixed2(this.zhData.zhMoney)
			// 		this.zhData.flhxMoney = util.toFixed2(this.zhData.flhxMoney)
			// 		this.zhData.cxhxMoney = util.toFixed2(this.zhData.cxhxMoney)
			// 		this.zhData.cusMoneyFrozen.fmoney = util.toFixed2(this.zhData.cusMoneyFrozen.fmoney)
			// 	});
				
				
		},
		
		onLoad() {

		},
		methods: {
		},


	}
</script>

<style scoped lang="scss">
	page {
		width: 100%;
		height: 100%;
	}


</style>